Why not write all tests at once when doing TDD? [closed]
Posted
by
RichK
on Programmers
See other posts from Programmers
or by RichK
Published on 2012-04-02T10:28:58Z
Indexed on
2012/04/02
17:40 UTC
Read the original article
Hit count: 223
TDD
Possible Duplicate:
Why not write all tests at once when doing TDD?
The Red - Green - Refactor cycle for TDD is well established and accepted. We write one failing unit test and make it pass as simply as possible. What are the benefits to this approach over writing many failing unit tests for a class and make them all pass in one go.
The test suite still protects you against writing incorrect code or making mistakes in the refactoring stage, and code coverage should be just as high, so what's the harm? Sometimes it's easier to write all the tests first as a form of 'brain dump' to quickly write down all the expected behavior in one go.
© Programmers or respective owner